home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / macros / plain / contrib / bnfexample.tex < prev    next >
LaTeX Document  |  1992-08-26  |  2.5 KB

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: LaTeX Document (document/latex).

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert LaTeX Document (document/latex) magic Supported
100% dexvert Texinfo Document (document/texInfo) magic Supported
1% dexvert Corel 10 Texture (image/corel10Texture) ext Unsupported
1% dexvert Croteam texture file (image/croteamTextureFile) ext Unsupported
1% dexvert Text File (text/txt) fallback Supported
100% file TeX document text default
99% file LaTeX document, ASCII text default
100% checkBytes Printable ASCII default
100% perlTextCheck Likely Text (Perl) default
100% detectItEasy Format: plain text[LF] default (weak)
100% xdgMime text/x-matlab default (weak)



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 25 20 68 65 72 65 27 73 | 20 74 68 65 20 65 78 61 |% here's| the exa|
|00000010| 6d 70 6c 65 0a 5c 69 6e | 70 75 74 20 67 65 6e 65 |mple.\in|put gene|
|00000020| 72 69 63 2e 74 65 78 0a | 5c 69 6e 70 75 74 20 62 |ric.tex.|\input b|
|00000030| 6e 66 2e 74 65 78 0a 0a | 5c 62 65 67 69 6e 67 72 |nf.tex..|\begingr|
|00000040| 61 6d 6d 61 72 0a 25 09 | 09 0a 3c 69 6e 70 75 74 |ammar.%.|..<input|
|00000050| 3e 3a 09 7b 24 5c 70 68 | 69 24 7d 3b 0a 09 09 3c |>:.{$\ph|i$};...<|
|00000060| 73 74 61 74 65 6d 65 6e | 74 3e 2e 5c 70 61 72 0a |statemen|t>.\par.|
|00000070| 0a 3c 73 74 61 74 65 6d | 65 6e 74 3e 3a 09 22 24 |.<statem|ent>:."$|
|00000080| 5c 7b 24 22 20 3c 63 6f | 6d 70 6f 75 6e 64 3e 20 |\{$" <co|mpound> |
|00000090| 22 24 5c 7d 24 22 20 5b | 22 3b 22 5d 20 3b 0a 09 |"$\}$" [|";"] ;..|
|000000a0| 09 3c 73 69 6e 67 6c 65 | 3e 20 5b 22 3b 22 5d 20 |.<single|> [";"] |
|000000b0| 3b 0a 09 09 22 3b 22 2e | 0a 0a 3c 63 6f 6d 70 6f |;...";".|..<compo|
|000000c0| 75 6e 64 3e 3a 09 3c 73 | 69 6e 67 6c 65 3e 20 22 |und>:.<s|ingle> "|
|000000d0| 3b 22 20 3c 63 6f 6d 70 | 6f 75 6e 64 3e 20 3b 0a |;" <comp|ound> ;.|
|000000e0| 09 09 3c 73 69 6e 67 6c | 65 3e 2e 0a 0a 3c 73 69 |..<singl|e>...<si|
|000000f0| 6e 67 6c 65 3e 3a 09 22 | 69 66 22 20 22 28 22 20 |ngle>:."|if" "(" |
|00000100| 3c 65 78 70 72 65 73 73 | 69 6f 6e 3e 20 22 29 22 |<express|ion> ")"|
|00000110| 20 3c 73 74 61 74 65 6d | 65 6e 74 3e 20 5b 22 65 | <statem|ent> ["e|
|00000120| 6c 73 65 22 20 3c 73 74 | 61 74 65 6d 65 6e 74 3e |lse" <st|atement>|
|00000130| 5d 3b 0a 09 09 22 63 61 | 73 65 22 20 22 24 5c 7b |];..."ca|se" "$\{|
|00000140| 24 22 20 3c 63 61 73 65 | 2d 62 6f 64 79 3e 20 22 |$" <case|-body> "|
|00000150| 24 5c 7d 24 22 3b 0a 09 | 09 22 66 6f 72 22 20 22 |$\}$";..|."for" "|
|00000160| 28 22 20 3c 65 78 70 72 | 65 73 73 69 6f 6e 3e 20 |(" <expr|ession> |
|00000170| 22 3b 22 20 3c 65 78 70 | 72 65 73 73 69 6f 6e 3e |";" <exp|ression>|
|00000180| 20 22 3b 22 20 3c 65 78 | 70 72 65 73 73 69 6f 6e | ";" <ex|pression|
|00000190| 3e 20 22 29 22 2c 0a 09 | 09 09 3c 73 74 61 74 65 |> ")",..|..<state|
|000001a0| 6d 65 6e 74 3e 3b 0a 09 | 09 22 77 68 69 6c 65 22 |ment>;..|."while"|
|000001b0| 20 22 28 22 20 3c 65 78 | 70 72 65 73 73 69 6f 6e | "(" <ex|pression|
|000001c0| 3e 20 22 29 22 20 3c 73 | 74 61 74 65 6d 65 6e 74 |> ")" <s|tatement|
|000001d0| 3e 3b 0a 09 09 22 64 6f | 22 20 3c 65 78 70 72 65 |>;..."do|" <expre|
|000001e0| 73 73 69 6f 6e 3e 20 22 | 77 68 69 6c 65 22 20 22 |ssion> "|while" "|
|000001f0| 28 22 20 3c 65 78 70 72 | 65 73 73 69 6f 6e 3e 20 |(" <expr|ession> |
|00000200| 22 29 22 3b 0a 09 09 22 | 73 75 6d 22 20 22 28 22 |")";..."|sum" "("|
|00000210| 20 3c 65 78 70 72 65 73 | 73 69 6f 6e 3e 20 22 3b | <expres|sion> ";|
|00000220| 22 20 3c 65 78 70 72 65 | 73 73 69 6f 6e 3e 20 22 |" <expre|ssion> "|
|00000230| 29 22 20 3c 73 74 61 74 | 6d 65 6e 74 3e 3b 0a 09 |)" <stat|ment>;..|
|00000240| 09 22 70 72 6f 64 75 63 | 74 22 20 22 28 22 20 3c |."produc|t" "(" <|
|00000250| 65 78 70 72 65 73 73 69 | 6f 6e 3e 20 22 3b 22 20 |expressi|on> ";" |
|00000260| 3c 65 78 70 72 65 73 73 | 69 6f 6e 3e 20 22 29 22 |<express|ion> ")"|
|00000270| 20 3c 73 74 61 74 6d 65 | 6e 74 3e 3b 0a 09 09 22 | <statme|nt>;..."|
|00000280| 62 72 65 61 6b 22 3b 0a | 09 09 22 63 6f 6e 74 69 |break";.|.."conti|
|00000290| 6e 75 65 22 3b 0a 09 09 | 22 72 65 74 75 72 6e 22 |nue";...|"return"|
|000002a0| 20 3c 65 78 70 72 65 73 | 73 69 6f 6e 3e 3b 0a 09 | <expres|sion>;..|
|000002b0| 09 22 63 6c 65 61 72 22 | 3b 0a 09 09 22 6c 6f 61 |."clear"|;..."loa|
|000002c0| 64 22 20 3c 65 78 70 72 | 65 73 73 69 6f 6e 3e 3b |d" <expr|ession>;|
|000002d0| 0a 09 09 22 73 61 76 65 | 22 20 3c 65 78 70 72 65 |..."save|" <expre|
|000002e0| 73 73 69 6f 6e 3e 3b 0a | 09 09 22 72 65 6c 65 61 |ssion>;.|.."relea|
|000002f0| 73 65 22 20 3c 65 78 70 | 72 65 73 73 69 6f 6e 3e |se" <exp|ression>|
|00000300| 3b 0a 09 09 22 73 68 6f | 77 22 20 5b 22 76 61 72 |;..."sho|w" ["var|
|00000310| 69 61 62 6c 65 73 22 20 | 7c 20 22 66 75 6e 63 74 |iables" || "funct|
|00000320| 69 6f 6e 73 22 20 7c 20 | 22 73 65 74 22 20 7c 20 |ions" | |"set" | |
|00000330| 22 61 6c 6c 22 20 7c 20 | 3c 65 78 70 72 65 73 73 |"all" | |<express|
|00000340| 69 6f 6e 3e 5d 3b 0a 09 | 09 22 73 65 74 22 20 20 |ion>];..|."set" |
|00000350| 5b 22 70 72 6f 6d 70 74 | 22 20 7c 20 22 70 72 65 |["prompt|" | "pre|
|00000360| 63 69 73 69 6f 6e 22 5d | 20 5b 3c 65 78 70 72 65 |cision"]| [<expre|
|00000370| 73 73 69 6f 6e 3e 5d 3b | 0a 09 09 3c 65 71 75 61 |ssion>];|...<equa|
|00000380| 74 69 6f 6e 3e 2e 0a 0a | 3c 63 61 73 65 2d 62 6f |tion>...|<case-bo|
|00000390| 64 79 3e 3a 09 22 63 61 | 73 65 22 20 3c 65 78 70 |dy>:."ca|se" <exp|
|000003a0| 72 65 73 73 69 6f 6e 3e | 20 22 3a 22 20 3c 63 6f |ression>| ":" <co|
|000003b0| 6d 70 6f 75 6e 64 3e 20 | 3c 63 61 73 65 2d 62 6f |mpound> |<case-bo|
|000003c0| 64 79 3e 3b 0a 09 09 20 | 22 64 65 66 61 75 6c 74 |dy>;... |"default|
|000003d0| 3a 22 20 3c 63 6f 6d 70 | 6f 75 6e 64 3e 0a 0a 3c |:" <comp|ound>..<|
|000003e0| 65 71 75 61 74 69 6f 6e | 3e 3a 09 3c 76 61 72 3e |equation|>:.<var>|
|000003f0| 20 22 3d 22 20 3c 65 78 | 70 72 65 73 73 69 6f 6e | "=" <ex|pression|
|00000400| 3e 3b 0a 09 09 3c 76 61 | 72 3e 22 5b 22 20 3c 73 |>;...<va|r>"[" <s|
|00000410| 65 6c 65 63 74 6f 72 3e | 20 22 5d 22 20 3d 20 3c |elector>| "]" = <|
|00000420| 65 78 70 72 65 73 73 69 | 6f 6e 3e 3b 0a 09 09 3c |expressi|on>;...<|
|00000430| 66 75 6e 63 74 69 6f 6e | 3e 20 3d 20 3c 69 6e 70 |function|> = <inp|
|00000440| 75 74 3e 3b 0a 09 09 3c | 65 78 70 72 65 73 73 69 |ut>;...<|expressi|
|00000450| 6f 6e 3e 2e 0a 0a 3c 73 | 65 6c 65 63 74 6f 72 3e |on>...<s|elector>|
|00000460| 3a 09 3c 66 61 63 74 6f | 72 3e 20 22 2c 22 20 3c |:.<facto|r> "," <|
|00000470| 66 61 63 74 6f 72 3e 3b | 0a 09 09 3c 66 61 63 74 |factor>;|...<fact|
|00000480| 6f 72 3e 20 22 2c 22 3b | 0a 09 09 22 2c 22 20 3c |or> ",";|..."," <|
|00000490| 66 61 63 74 6f 72 3e 2e | 0a 0a 3c 65 78 70 72 65 |factor>.|..<expre|
|000004a0| 73 73 69 6f 6e 3e 3a 09 | 3c 74 65 72 6d 3e 20 22 |ssion>:.|<term> "|
|000004b0| 2b 22 20 3c 65 78 70 72 | 65 73 73 69 6f 6e 3e 3b |+" <expr|ession>;|
|000004c0| 0a 09 09 3c 74 65 72 6d | 3e 20 22 2d 2d 22 20 3c |...<term|> "--" <|
|000004d0| 65 78 70 72 65 73 73 69 | 6f 6e 3e 2e 09 09 0a 0a |expressi|on>.....|
|000004e0| 3c 74 65 72 6d 3e 3a 09 | 09 3c 66 61 63 74 6f 72 |<term>:.|.<factor|
|000004f0| 3e 20 3c 6f 70 65 72 61 | 74 6f 72 3e 20 3c 74 65 |> <opera|tor> <te|
|00000500| 72 6d 3e 2e 0a 0a 3c 66 | 61 63 74 6f 72 3e 09 3c |rm>...<f|actor>.<|
|00000510| 70 72 65 2d 6f 70 3e 20 | 3c 66 61 63 74 6f 72 24 |pre-op> |<factor$|
|00000520| 27 24 3e 20 3c 70 6f 73 | 74 2d 6f 70 3e 2e 0a 0a |'$> <pos|t-op>...|
|00000530| 3c 66 61 63 74 6f 72 24 | 27 24 3e 3a 09 3c 6e 75 |<factor$|'$>:.<nu|
|00000540| 6d 62 65 72 3e 3b 0a 09 | 09 22 2b 22 20 3c 6e 75 |mber>;..|."+" <nu|
|00000550| 6d 62 65 72 3e 3b 0a 09 | 09 22 2d 2d 22 20 3c 6e |mber>;..|."--" <n|
|00000560| 75 6d 62 65 72 3e 3b 0a | 09 09 22 28 22 20 3c 6e |umber>;.|.."(" <n|
|00000570| 75 6d 62 65 72 3e 20 22 | 29 22 3b 0a 09 09 3c 76 |umber> "|)";...<v|
|00000580| 61 72 69 61 62 6c 65 3e | 3b 0a 09 09 3c 76 61 72 |ariable>|;...<var|
|00000590| 69 61 62 6c 65 3e 22 5b | 22 20 3c 73 65 6c 65 63 |iable>"[|" <selec|
|000005a0| 74 6f 72 3e 20 22 5d 22 | 3b 0a 09 09 3c 73 74 72 |tor> "]"|;...<str|
|000005b0| 69 6e 67 3e 3b 0a 09 09 | 3c 6d 61 74 72 69 78 3e |ing>;...|<matrix>|
|000005c0| 3b 0a 09 09 3c 66 75 6e | 63 74 69 6f 6e 3e 2e 0a |;...<fun|ction>..|
|000005d0| 0a 3c 70 72 65 2d 6f 70 | 3e 3a 09 22 2b 2b 22 20 |.<pre-op|>:."++" |
|000005e0| 7c 20 22 2d 2d 7b 5c 6b | 65 72 6e 20 31 70 74 7d || "--{\k|ern 1pt}|
|000005f0| 2d 2d 22 20 7c 20 22 24 | 5c 73 69 6d 24 22 20 7c |--" | "$|\sim$" ||
|00000600| 20 22 21 22 2e 0a 0a 3c | 70 6f 73 74 2d 6f 70 3e | "!"...<|post-op>|
|00000610| 3a 09 22 24 5c 75 70 61 | 72 72 6f 77 24 22 20 3c |:."$\upa|rrow$" <|
|00000620| 66 61 63 74 6f 72 3e 20 | 0a 09 09 7c 20 22 2a 2a |factor> |...| "**|
|00000630| 22 20 3c 66 61 63 74 6f | 72 3e 3b 0a 09 09 22 2b |" <facto|r>;..."+|
|00000640| 2b 22 20 7c 20 22 2d 2d | 7b 5c 6b 65 72 6e 20 31 |+" | "--|{\kern 1|
|00000650| 70 74 7d 2d 2d 22 20 7c | 20 22 21 22 2e 09 09 0a |pt}--" || "!"....|
|00000660| 0a 3c 6d 61 74 72 69 78 | 3e 3a 09 22 5b 22 20 3c |.<matrix|>:."[" <|
|00000670| 72 6f 77 2d 6c 69 73 74 | 3e 20 22 5d 22 2e 0a 0a |row-list|> "]"...|
|00000680| 3c 72 6f 77 2d 6c 69 73 | 74 3e 3a 09 22 5b 22 20 |<row-lis|t>:."[" |
|00000690| 3c 76 61 6c 75 65 2d 6c | 69 73 74 3e 20 22 5d 22 |<value-l|ist> "]"|
|000006a0| 20 5b 22 2c 22 5d 20 3c | 72 6f 77 2d 6c 69 73 74 | [","] <|row-list|
|000006b0| 3e 3b 0a 09 09 22 5b 22 | 20 3c 76 61 6c 75 65 2d |>;..."["| <value-|
|000006c0| 6c 69 73 74 3e 20 22 5d | 22 20 5b 22 2c 22 5d 20 |list> "]|" [","] |
|000006d0| 3c 72 6f 77 2d 6c 69 73 | 74 3e 3b 0a 09 09 3c 76 |<row-lis|t>;...<v|
|000006e0| 61 6c 75 65 2d 6c 69 73 | 74 3e 2e 0a 0a 3c 76 61 |alue-lis|t>...<va|
|000006f0| 6c 75 65 2d 6c 69 73 74 | 3e 3a 09 5b 20 3c 73 74 |lue-list|>:.[ <st|
|00000700| 72 69 6e 67 3e 20 5d 20 | 3c 65 78 70 72 65 73 73 |ring> ] |<express|
|00000710| 69 6f 6e 3e 20 22 2c 22 | 20 3c 76 61 6c 75 65 2d |ion> ","| <value-|
|00000720| 6c 69 73 74 3e 3b 0a 09 | 09 5b 20 3c 73 74 72 69 |list>;..|.[ <stri|
|00000730| 6e 67 3e 20 5d 20 3c 65 | 78 70 72 65 73 73 69 6f |ng> ] <e|xpressio|
|00000740| 6e 3e 2e 0a 0a 3c 66 75 | 6e 63 74 69 6f 6e 3e 3a |n>...<fu|nction>:|
|00000750| 09 3c 76 61 72 69 61 62 | 6c 65 3e 20 22 28 22 20 |.<variab|le> "(" |
|00000760| 3c 61 72 67 2d 6c 69 73 | 74 3e 20 22 29 22 2e 0a |<arg-lis|t> ")"..|
|00000770| 0a 3c 61 72 67 2d 6c 69 | 73 74 3e 3a 09 24 5c 70 |.<arg-li|st>:.$\p|
|00000780| 68 69 24 3b 0a 09 09 3c | 76 61 72 69 61 62 6c 65 |hi$;...<|variable|
|00000790| 3e 20 22 2c 22 20 3c 61 | 72 67 6c 69 73 74 3e 3b |> "," <a|rglist>;|
|000007a0| 0a 09 09 22 5c 64 6f 74 | 73 22 2e 0a 0a 3c 73 74 |..."\dot|s"...<st|
|000007b0| 72 69 6e 67 3e 3a 09 22 | 20 60 60 20 22 20 20 3c |ring>:."| `` " <|
|000007c0| 61 6e 79 74 68 69 6e 67 | 3e 20 22 20 27 27 20 22 |anything|> " '' "|
|000007d0| 2e 0a 0a 3c 6e 75 6d 62 | 65 72 3e 3a 09 3c 72 65 |...<numb|er>:.<re|
|000007e0| 61 6c 2d 6e 75 6d 62 65 | 72 3e 3b 0a 09 09 22 24 |al-numbe|r>;..."$|
|000007f0| 5c 7b 24 22 20 3c 72 65 | 61 6c 2d 6e 75 6d 62 65 |\{$" <re|al-numbe|
|00000800| 72 3e 20 22 2c 22 20 3c | 72 65 61 6c 2d 6e 75 6d |r> "," <|real-num|
|00000810| 62 65 72 3e 20 22 24 5c | 7d 24 22 3b 0a 09 09 7b |ber> "$\|}$";...{|
|00000820| 24 5c 62 61 63 6b 73 6c | 61 73 68 24 7d 62 5b 30 |$\backsl|ash$}b[0|
|00000830| 31 5d 5b 30 31 5d 2b 3b | 0a 09 09 7b 24 5c 62 61 |1][01]+;|...{$\ba|
|00000840| 63 6b 73 6c 61 73 68 24 | 7d 6f 5b 30 37 5d 5b 30 |ckslash$|}o[07][0|
|00000850| 37 5d 2b 3b 0a 09 09 5c | 24 5b 30 2d 39 41 2d 46 |7]+;...\|$[0-9A-F|
|00000860| 61 2d 66 5d 5b 30 2d 39 | 41 2d 46 61 2d 66 5d 2b |a-f][0-9|A-Fa-f]+|
|00000870| 2e 0a 0a 25 3c 72 65 61 | 6c 2d 6e 75 6d 62 65 72 |...%<rea|l-number|
|00000880| 3e 3a 09 5b 5c 2b 2d 2d | 5d 3f 5b 30 2d 39 5d 5b |>:.[\+--|]?[0-9][|
|00000890| 30 2d 39 5d 2b 5b 5c 2e | 5b 30 2d 39 5d 2b 5d 3f |0-9]+[\.|[0-9]+]?|
|000008a0| 5b 5b 65 45 5d 5b 30 2d | 39 5d 5b 30 2d 39 5d 2b |[[eE][0-|9][0-9]+|
|000008b0| 5d 2e 0a 0a 3c 6f 70 65 | 72 61 74 6f 72 3e 3a 09 |]...<ope|rator>:.|
|000008c0| 22 2a 22 20 7c 09 20 22 | 2f 22 09 7c 20 20 20 20 |"*" |. "|/".| |
|000008d0| 20 22 24 5c 62 61 63 6b | 73 6c 61 73 68 24 22 09 | "$\back|slash$".|
|000008e0| 7c 20 22 5c 25 22 3b 0a | 09 09 22 3d 3d 22 20 7c || "\%";.|.."==" ||
|000008f0| 09 20 22 21 3d 22 09 7c | 20 20 20 20 20 22 24 3e |. "!=".|| "$>|
|00000900| 24 22 20 09 09 7c 20 22 | 24 3c 24 22 20 20 0a 09 |$" ..| "|$<$" ..|
|00000910| 09 7c 20 22 24 3c 24 3d | 22 20 7c 20 22 24 3e 24 |.| "$<$=|" | "$>$|
|00000920| 3d 22 3b 0a 09 09 22 5c | 75 6c 20 3d 22 09 7c 20 |=";..."\|ul =".| |
|00000930| 22 5c 75 6c 20 21 3d 22 | 20 7c 20 20 22 5c 75 6c |"\ul !="| | "\ul|
|00000940| 20 24 3c 24 22 20 7c 20 | 22 5c 75 6c 20 24 3e 24 | $<$" | |"\ul $>$|
|00000950| 22 20 0a 09 09 7c 20 22 | 5c 75 6c 24 3c 24 3d 22 |" ...| "|\ul$<$="|
|00000960| 20 7c 20 22 5c 75 6c 24 | 3e 24 3d 22 3b 0a 09 09 | | "\ul$|>$=";...|
|00000970| 22 5c 26 22 09 20 7c 20 | 22 24 5c 76 65 72 74 24 |"\&". | |"$\vert$|
|00000980| 22 20 20 7c 20 22 24 5c | 75 70 61 72 72 6f 77 5c |" | "$\|uparrow\|
|00000990| 75 70 61 72 72 6f 77 24 | 22 3b 0a 09 09 22 5c 26 |uparrow$|";..."\&|
|000009a0| 5c 26 22 09 7c 20 22 24 | 5c 56 65 72 74 24 22 20 |\&".| "$|\Vert$" |
|000009b0| 20 7c 20 22 5c 75 6c 24 | 5c 75 70 61 72 72 6f 77 | | "\ul$|\uparrow|
|000009c0| 24 22 2e 0a 09 09 0a 5c | 65 6e 64 67 72 61 6d 6d |$".....\|endgramm|
|000009d0| 61 72 0a 5c 62 79 65 0a | 0a |ar.\bye.|. |
+--------+-------------------------+-------------------------+--------+--------+